﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Mail;
using System.Windows;

namespace Kiosk.Utilities
{
    public static class Email
    {

        public static void Send(string toAddress, string subject, string body)
        {
            try
            {
                MailMessage message = new MailMessage(
                    new MailAddress("kiosk@magenic.com", "Kiosk Alert"),
                    new MailAddress(toAddress));

                message.Priority = MailPriority.High;

                message.Subject = subject;
                message.Body = body;

                SmtpClient smtpClient = new SmtpClient("postmaster.magenic.com", 25);
                smtpClient.Send(message);
            }
            catch (Exception ex)
            { 
                MessageBox.Show("Failure sending alert: " + ex.ToString());
            }
        }
    }
}
